feat(hpc): WHT polyfill, i2 quantization, pub kmeans#105
Merged
Conversation
No sonnet. All 10 ndarray agents now pin model: opus. https://claude.ai/code/session_01NYGrxVopyszZYgLBxe4hgj
Three additive pieces for the HadCascade codec in bgz-tensor:
1. wht_f32() in fft.rs — Walsh-Hadamard Transform with F32x16 SIMD
butterfly. O(n log n), self-inverse, energy-preserving. 3 tests +
doctest. Same module family as FFT (Cooley-Tukey).
2. quantize_f32_to_i2 / dequantize_i2_to_f32 in quantized.rs —
ternary {-1, 0, +1} quantization, 4 crumbs per byte. Completes
the i4/i8/u8/BF16 quantization suite for the i2 residue pass.
3. pub fn kmeans() and pub fn squared_l2() in cam_pq.rs — were
private helpers, now public. Farthest-first init + Lloyd's
iterations, SIMD-dispatched L2 distance.
https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
AdaWorldAPI
pushed a commit
that referenced
this pull request
Apr 19, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fft.rs— F32x16 SIMD butterfly, O(n log n), self-inverse, energy-preserving. 3 unit tests + doctest. Same module family as FFT.quantized.rs—quantize_f32_to_i2/dequantize_i2_to_f32, ternary {-1,0,+1}, 4 crumbs per byte. Completes the i4/i8/u8/BF16 suite.pub fn kmeans()andpub fn squared_l2()incam_pq.rs— were private helpers, now public for downstream codec use.These are the additive polyfills needed by
bgz-tensor::had_cascade(the production Hadamard cascade codec that achieved ICC 0.999 on real model weights).Test plan
cargo test -p ndarray -- hpc::fft— 6 tests pass (3 FFT + 3 WHT)test_kmeans_basic)https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh